home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97a.txt / 000131_icon-group-sender _Tue Jun 10 09:34:24 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Tue, 10 Jun 1997 12:27:50 MST
  2. Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM)
  3.     id AA08354; Tue, 10 Jun 1997 12:27:50 -0700
  4. Date: Tue, 10 Jun 1997 09:34:24 -0700
  5. From: swampler@noao.edu (Steve Wampler)
  6. Subject: Re: searching with variables
  7. To: icon-group@cs.arizona.edu
  8. Message-Id: <swampler-9705101634.AA002714681@orpheus.gemini.edu>
  9. Errors-To: icon-group-errors@cs.arizona.edu
  10. Status: RO
  11. Content-Length: 1654
  12.  
  13.  
  14.  
  15. - Forwarded message from Stuart.Robinson@anu.edu.au on Tue, 10 Jun 1997 22:30:39 +1000 -
  16. > A quick question.  If you wanted to use the function find() to search for
  17. > a particular strings of characters, how would it be possible to define
  18. > character variables?  For example, suppose you want to search for the
  19. > following sequences
  20. > al
  21. > el
  22. > il
  23. > ol
  24. > ul
  25. > which are really just Vl (where V stands for a vowel).  Could you simply
  26. > define a character set for vowels (V := 'aeiou') and then refer to that
  27. > character set in the find() function?  If so, what would it look like?  I
  28. > tried something like the following and it didn't work.
  29. > find( V || "l")
  30. > I realise it's a pretty trivial task but I don't have the manual at the
  31. > moment and I'd like an answer within the next couple of days.  Thanks in
  32. > advance.
  33.  
  34. You can try:
  35.  
  36.     find( !V || "l" )
  37.  
  38. which will work, *but*, the order of the two generators (find and !) means
  39. that you will look throughout the subject for the first string ("al") before
  40. backtracking and looking throughout the subject for the second string ("el"),
  41. etc.  This means you find "al" anywhere in the subject before finding "el"
  42. anywhere in the subject.  All occurrences will be found, just not necessarily
  43. in the order you might have expected.
  44.  
  45. It's an interesting exercise to come up with a clean approach that locates
  46. any of "al","el","il","ol","ul" in the order they appear in the subject.
  47. Perhaps others can suggest solutions to this?
  48.  
  49. --
  50. Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under AURA)]
  51. O Sibile, si ergo, fortibus es inero.
  52. Nobile, demis trux.  Demis phulla causan dux.
  53.